/**
 * @file channel.h
 * @brief Decalares constants and macros that are common across different 
 *        channel implementations (peer channels and host channels).
 * @author Vamshi Ponnapalli
 */
#ifndef _WIZI_CHANNEL_H
  #define _WIZI_CHANNEL_H

  /*****************************************************************************
   * Includes
   ****************************************************************************/
  #include "hal_types.h"
  #include "hal_defs.h"

  /*****************************************************************************
   * Type definitions
   ****************************************************************************/
  // Event handler function pointer
  typedef void (*CHANNEL_EVENT_HANDLER)(uint8);

  /**
   * An enumeration of possible states of the host channel.
   */
  enum channel_State
  {
    //The channel is being initialized, and is not ready for use.
    CHANNEL_STATE_INIT = 0,
    
    //The channel has been initialized, and is ready for use.
    CHANNEL_STATE_READY = 1,
    
    //The channel is open, and ready for send/receive operations.
    CHANNEL_STATE_OPEN = 2,
      
    //The channel is closed.
    CHANNEL_STATE_CLOSED = 3,
    
    //The channel is in an error state, and cannot be used.
    CHANNEL_STATE_ERROR = 4
  };
  
#endif
